---
title: "Overview"
description: "TypeScript SDK for Dub.co"
---

## Install

<Tabs>
  <Tab title="npm">

    ```bash
    npm install dub
    ```

  </Tab>
  
  <Tab title="pnpm">
  
  ```bash 
  pnpm add dub 
  ```
  
  </Tab>
  
  <Tab title="yarn">
  
  ```bash
  yarn add dub 
  ```
  
  </Tab>
</Tabs>

## Options

The SDK constructor accepts an options object with the following properties:

<ParamField body="token" type="string" required>
  The API token for the Dub.co API. You can create your token from the [Dub.co
  dashboard](https://app.dub.co/settings/tokens).
</ParamField>

<ParamField body="workspaceId" type="string" required>
  The id of the workspace you want to interact with. [Learn how to get your
  Workspace ID on Dub?](https://dub.co/help/article/how-to-get-workspace-id)
</ParamField>

<ParamField body="projectSlug" type="string">
  The slug of the project you want to interact with. `projectSlug` is
  deprecated, use `workspaceId` instead.
</ParamField>

## Usage

```typescript
import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "ws_clugls3...",
});

await dub.links.create({
  url: "https://google/com",
});
```